package com.muyu.user.domain.model;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.web.model.QueryModel;
import com.muyu.user.domain.req.SysUserCouponQueryReq;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 用户优惠券记录查询请求模型对象
 *
 * @author liuguoqiang
 * @date 2025-09-18
 */
@Data
@SuperBuilder
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SysUserCouponQueryModel extends QueryModel<SysUserCouponQueryModel> {

    /**
     * 优惠券名称
     */
    private String couponName;

    /**
     * 面值
     */
    private BigDecimal faceValue;

    /**
     * 最低消费额
     */
    private BigDecimal minAmount;

    /**
     * 有效期
     */
    private Date expireTime;

    /**
     * 兑换/发放时间
     */
    private Date exchangeTime;

    /**
     * 查询构造器
     */
    public static SysUserCouponQueryModel reqBuild( SysUserCouponQueryReq queryReq){
        SysUserCouponQueryModel sysUserCouponQueryModel = SysUserCouponQueryModel.builder()
            .couponName(queryReq.getCouponName())
            .faceValue(queryReq.getFaceValue())
            .minAmount(queryReq.getMinAmount())
            .expireTime(queryReq.getExpireTime())
            .exchangeTime(queryReq.getExchangeTime())
            .build();
        sysUserCouponQueryModel.domainBuild(queryReq);
        return sysUserCouponQueryModel;
    }
}
